package com.fegin.api;

import com.fegin.api.service.Firend;
import com.fegin.api.service.IService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Author:RenPu
 * @Date: 2020/8/27 18:47
 * @Version: 1.0
 * @description:
 */

@RestController
@Slf4j
public class FeginConsumerController {

    @Resource
    private IService iService;

    @GetMapping("/sayHi")
    public String eurekaClientTest(String test) {

        return iService.eurekaClientTest(test);
    }


    @PostMapping("/sayHi")
    public Firend testPostMethond() {
        Firend firend1 = new Firend();
        firend1.setName("test");
        return iService.testPostMethond(firend1);

    }


    @GetMapping("retry")
    public String retry(@RequestParam(value = "timeout", required = false) Integer timeout) {
        return iService.retry(timeout);
    }


}
